package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

@Entity
@Table(name = "qemp_from", schema = "springboot", catalog = "")
public class QempFrom {
    private Integer empId;
    private QdepFrom depId;
    private String empName;
    private String empGender;
    private String empPhone;
    private String empAdd;
    private String empAddnum;
    private String empSfz;
    private BigDecimal empSalary;
    private String empService;
    private String empMima;
    private Timestamp empSettime;
    private String empStatu;
    private String empDeadd;
    private String empDepnum;
    private QroleFrom roleId;
    private Integer empUpposition;
    private String empImgpath;
    private List<QempFrom> emplist;

    @Id
    @Column(name = "emp_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getEmpId() {
        return empId;
    }

    public void setEmpId(Integer empId) {
        this.empId = empId;
    }

    @ManyToOne
    @JoinColumn(name = "dep_id", referencedColumnName = "dep_id")
    public QdepFrom getDepId() {
        return depId;
    }
    public void setDepId(QdepFrom depId) {
        this.depId = depId;
    }

    @ManyToOne
    @JoinColumn(name = "role_id", referencedColumnName = "role_id")
    public QroleFrom getRoleId() {
        return roleId;
    }

    public void setRoleId(QroleFrom roleId) {
        this.roleId = roleId;
    }

    @OneToMany(mappedBy = "empId")
    public List<QempFrom> getEmplist() {
        return emplist;
    }

    public void setEmplist(List<QempFrom> emplist) {
        this.emplist = emplist;
    }

    @Basic
    @Column(name = "emp_name")
    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    @Basic
    @Column(name = "emp_gender")
    public String getEmpGender() {
        return empGender;
    }

    public void setEmpGender(String empGender) {
        this.empGender = empGender;
    }

    @Basic
    @Column(name = "emp_settime")
    public Timestamp getEmpSettime() {
        return empSettime;
    }

    public void setEmpSettime(Timestamp empSettime) {
        this.empSettime = empSettime;
    }

    @Basic
    @Column(name = "emp_phone")
    public String getEmpPhone() {
        return empPhone;
    }

    @Basic
    @Column(name = "emp_deadd")
    public String getEmpDeadd() {
        return empDeadd;
    }

    public void setEmpDeadd(String empDeadd) {
        this.empDeadd = empDeadd;
    }

    public void setEmpPhone(String empPhone) {
        this.empPhone = empPhone;
    }

    @Basic
    @Column(name = "emp_statu")
    public String getEmpStatu() {
        return empStatu;
    }

    public void setEmpStatu(String empStatu) {
        this.empStatu = empStatu;
    }


    @Basic
    @Column(name = "emp_imgpath")
    public String getEmpImgpath() {
        return empImgpath;
    }

    public void setEmpImgpath(String empImgpath) {
        this.empImgpath = empImgpath;
    }



    @Basic
    @Column(name = "emp_upposition")
    public Integer getEmpUpposition() {
        return empUpposition;
    }

    public void setEmpUpposition(Integer empUpposition) {
        this.empUpposition = empUpposition;
    }

    @Basic
    @Column(name = "emp_add")
    public String getEmpAdd() {
        return empAdd;
    }

    public void setEmpAdd(String empAdd) {
        this.empAdd = empAdd;
    }

    @Basic
    @Column(name = "emp_addnum")
    public String getEmpAddnum() {
        return empAddnum;
    }

    public void setEmpAddnum(String empAddnum) {
        this.empAddnum = empAddnum;
    }

    @Basic
    @Column(name = "emp_depnum")
    public String getEmpDepnum() {
        return empDepnum;
    }

    public void setEmpDepnum(String empDepnum) {
        this.empDepnum = empDepnum;
    }

    @Basic
    @Column(name = "emp_sfz")
    public String getEmpSfz() {
        return empSfz;
    }

    public void setEmpSfz(String empSfz) {
        this.empSfz = empSfz;
    }

    @Basic
    @Column(name = "emp_salary")
    public BigDecimal getEmpSalary() {
        return empSalary;
    }

    public void setEmpSalary(BigDecimal empSalary) {
        this.empSalary = empSalary;
    }

    @Basic
    @Column(name = "emp_service")
    public String getEmpService() {
        return empService;
    }

    public void setEmpService(String empService) {
        this.empService = empService;
    }

    @Basic
    @Column(name = "emp_mima")
    public String getEmpMima() {
        return empMima;
    }

    public void setEmpMima(String empMima) {
        this.empMima = empMima;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        QempFrom qempFrom = (QempFrom) o;
        return empId == qempFrom.empId &&
                Objects.equals(depId, qempFrom.depId) &&
                Objects.equals(empName, qempFrom.empName) &&
                Objects.equals(empGender, qempFrom.empGender) &&
                Objects.equals(empPhone, qempFrom.empPhone) &&
                Objects.equals(empAdd, qempFrom.empAdd) &&
                Objects.equals(empSfz, qempFrom.empSfz) &&
                Objects.equals(empSalary, qempFrom.empSalary) &&
                Objects.equals(empService, qempFrom.empService) &&
                Objects.equals(empMima, qempFrom.empMima);
    }


    @Override
    public String toString() {
        return "QempFrom{" +
                "empId=" + empId +
                ", depId=" + depId +
                ", empName='" + empName + '\'' +
                ", empGender='" + empGender + '\'' +
                ", empPhone='" + empPhone + '\'' +
                ", empAdd='" + empAdd + '\'' +
                ", empSfz='" + empSfz + '\'' +
                ", empSalary=" + empSalary +
                ", empService='" + empService + '\'' +
                ", empMima='" + empMima + '\'' +
                ", roleId=" + roleId +
                '}';
    }
}
